<?php

namespace App\Models;

use support\Model;

/**
 * admins 管理员表
 * @property integer $id (主键)
 * @property string $nickname 昵称
 * @property string $email 登陆名
 * @property string $phone 手机号码
 * @property string $avatar 头像
 * @property string $password 密码
 * @property integer $status 用户状态
 * @property string $remember_token
 * @property string $token 接入芒果等系统的token
 * @property string $platform 用户使用平台
 * @property mixed $deleted_at
 * @property mixed $created_at
 * @property mixed $updated_at
 */
class Admin extends Model
{
    /**
     * The table associated with the Models.
     *
     * @var string
     */
    protected $table = 'admins';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';
    protected $hidden = ["password", "deleted_at", "token", "platform"];
    protected $guarded = [];

    /**
     * Indicates if the Models should be timestamped.
     *
     * @var bool
     */
    public $timestamps = true;

    public $cats = [
        "status" => "boolean",
        "created_at" => "datetime:Y-m-d H:i:s",
        "updated_at" => "datetime:Y-m-d H:i:s",
    ];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }


}
